<h1>Users</h1>

<a href="{$baseUri}/admin/users/add" class="btn btn-info">Add New User</a>

{if isset($message)}
    <div class="alert alert-dismissable alert-success">{$message}</div>
{/if}

<table class="table table-striped table-hover">
    <thead>
    <tr>
        <th>N</th>
        <th>User</th>
        <th>Role</th>
        <th>Manage</th>
    </tr>
    </thead>
    <tbody>
    {$i = 1}
    {foreach $users as $user}
        <tr>
            <td>{$i++}</td>
            <td>{$user['userName']}</td>
            <td>{$user['role']}</td>
            <td>
                <a href="{$baseUri}/admin/users/edit/{$user['id']}" class="btn btn-info">Edit user</a>
                <a href="{$baseUri}/admin/users/delete/{$user['id']}" onclick="return confirm('Are you sure you want to delete the user')" class="btn btn-info">Delete</a>
            </td>
        </tr>
    {/foreach}
    </tbody>
</table>
